EmSAT Achieve Exam  >  EmSAT Achieve Questions  >  class A{ protected int method1(int a, int b... Start Learning for Free
class A 
{  
    protected int method1(int a, int b) 
    {
        return 0; 
    } 
}
Which is valid in a class that extends class A?
  • a)
    public int method1(int a, int b) {return 0; }
  • b)
    private int method1(int a, int b) { return 0; }
  • c)
    public short method1(int a, int b) { return 0; }
  • d)
    static protected int method1(int a, int b) { return 0; }
Correct answer is option 'A'. Can you explain this answer?
Most Upvoted Answer
class A{ protected int method1(int a, int b) { return 0; }}Whic...
Option A is correct - because the class that extends A is just simply overriding method1.
Option B is wrong - because it can't override as there are less access privileges in the subclass method1.
Option C is wrong - because to override it, the return type needs to be an integer. The different return type means that the method is not overriding but the same argument list means that the method is not overloading. Conflict - compile time error.
Option D is wrong - because you can't override a method and make it a class method i.e. using static.
Explore Courses for EmSAT Achieve exam

Top Courses for EmSAT Achieve

Question Description
class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? for EmSAT Achieve 2025 is part of EmSAT Achieve preparation. The Question and answers have been prepared according to the EmSAT Achieve exam syllabus. Information about class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for EmSAT Achieve 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer?.
Solutions for class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for EmSAT Achieve. Download more important topics, notes, lectures and mock test series for EmSAT Achieve Exam by signing up for free.
Here you can find the meaning of class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer?, a detailed solution for class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice class A{ protected int method1(int a, int b) { return 0; }}Which is valid in a class that extends class A?a)public int method1(int a, int b) {return 0; }b)private int method1(int a, int b) { return 0; }c)public short method1(int a, int b) { return 0; }d)static protected int method1(int a, int b) { return 0; }Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice EmSAT Achieve tests.
Explore Courses for EmSAT Achieve exam

Top Courses for EmSAT Achieve

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev